Introduction

First of all, thank you so much for buying this script. If you will have anything to ask that is beyond the scope of this documentation, please feel free to contact me.

Z Desk - Support Tickets System with Knowledge Base and FAQs developed to create support ticketing system. It allows posting articles and FAQs. It supports the creation of multiple departments and user roles based on your needs.

  • Author: Shahzaib Sarwar
  • Email Address: zaiblab@yahoo.com
  • Created: 08/15/2021
  • Updated: 08/16/2024

Requirements

  • Linux Hosting
  • PHP Version 7.2+
  • MySQL Database
  • Internet Connection
  • mod_rewrite
  • mbstring
  • GD Library
  • cURL
  • DOM
  • Mail and SMTP
  • Email with IMAP Support
  • IMAP Module/Library
  • ZipArchive
  • DOM Extension

If you are not having the control to enable the disabled modules, then contact your hosting provider.

Installation

You have to follow the steps below to complete the installation:

Database Setup: First you have to create an empty database. After creating a database you are required to assign a user to it. The below steps are for cPanel:

  • Login to your cPanel account and find a section called Databases and click on the MySQL Databases.
  • Input your database name and click on Create Database button.
  • After the successful creation of the database, scroll down and find a section called MySQL Users. Fill in the input fields and click on Create User button.
  • After the registration of the user, you have to assign the created database to it with all the privileges.

Upload Files: Once you extracted the Z Desk files, you will found a folder called script. Login to your cPanel or whatever you are using to reach your web server and upload the files of the script directory where you are interested to install.

Most panels hide the dotfiles so, if moving the script, please make sure that the .htaccess file is not skipped.


Permissions: Now you have to change some file permissions. For the uploads/images (including subdirectories), application/config, and assets/backups, chmod 755 or 777 is required e.g.


Wizard: Goto your website path (where the script is uploaded) to reach the installer. The installer will check the dependencies to make sure that your server meets the requirements. In some circumstances, you might see a red icon with a cross mark. It's because the specific component is not enabled or matching the requirement.

The next step will check the folder permissions. If the installer is showing the red icons, please assign the permissions to folders (as guided above) and reload the page.

The input for Email Address and Password fields will be used to login as Super Admin.

The Live Chat module is disabled by default, you can enable it by going to the Admin Panel › Others › Settings › Support page and changing the Live Chatting field. Currently, the messages interval is 3 seconds for performance reasons and it's changeable (e.g. 1 second) but, it's not recommended.

In case you don't know:

The interval is simply a time gap or breaks that the script is following to communicate with the server for any new messages of the active chat.

The Guest Ticketing is disabled by default, you can enable it by going to the Admin Panel › Others › Settings › Support page and changing the Guest Ticketing field. Before enabling it, you'll have to add your email configurations in the Admin Panel › Others › Settings › Email. It's recommended to test the email settings to make sure that there is nothing wrong with the server or configuration details.

To select a different theme color, go to Admin Panel › Others › Settings › General › Appearance › Site Color.

After the installation, you will be required to delete the install directory for security reasons.


Cron Job: To handle the user presence, you should set the Cron job for every 15 minutes.

*/15 * * * * wget -O - https://yoururl.com/cron_job/regular >/dev/null 2>&1

Follow the below steps for cPanel:

  • Login to your cPanel account and find a section called Advanced and click on the Cron Jobs.
  • Now fill your fields accordingly (by following the example screenshot) and click on Add New Cron Job button.

Languages

The script comes with English but, if you are required to add another language translation then, you first have to create a folder inside the application/language as the language name, such as arabic, urdu, etc. Copy the all files (instead of email_lang.php) from application/language/english and paste them to your newly created folder.

The folder name must be in lower case and never delete or rename the english folder.

If you are focusing the content that starts writing from right to left direction (e.g. Arabic), you must use their ISO code (e.g. ar) even its LTR layout so the browser renders the text according to it and your text should be easy to read.

// USE THESE TRANSLATIONS FOR THE LAYOUT DIRECTION AND LANGUAGE ISO CODE:
$lang['lang_iso_code'] = 'en'; // Find ISO Codes: https://www.w3schools.com/tags/ref_language_codes.asp
$lang['theme_direction'] = 'ltr'; // Supported: 'ltr' or 'rtl'

// These Translations can be Found in the global_lang.php File.

You can now start editing these files for translation. To make the language available in the switcher, you need to add in the application/config/constants.php file. Search for the AVAILABLE_LANGUAGES array and create a new index for language. For example, to add the Arabic language:

define( 'AVAILABLE_LANGUAGES',
[
    'english' => ['display_label' => 'English'],
    'arabic' => ['display_label' => 'Arabic']
]);

The default language is English but, this can be changed. Goto application/config/config.php and search for $config['language']. Replace english with your language name (as lowercase). When the visitor changes the language, the chosen language will be remembered by the browser.

Don't forget to add the new language email templates by goto Admin Panel › Others › Email Templates.

Basic Guide

Show/Hide

Do your updates or changes by following the structure that you feel comfortable (CI ruling applies) with but, PLEASE AVOID THE MODIFICATIONS TO THE SCRIPT CORE STRUCTURE.

Assets: All the front-end assets for home and panel pages are placed inside the assets/default directory.


Third-party: All the third-party server-side libraries (instead of url_slug_helper.php) are placed inside the application/third_party directory.


Uploads: All the file-based inputs (e.g. images) are uploaded inside the uploads/images directory.


Form Validation: CI-based form validations rules are defined inside the application/config/form_validation.php file so, you don't have to goto the controllers to modify the rulings.


Actions: For the panel areas (user, admin) <form> actions, the separate controllers are created inside application/controllers/actions directory.


Theme: The default themes files are created inside the application/views/default directory. The script can have multiple themes so, you may wish to add your theme, then first goto application/config/constants.php file and find the SITE_THEMES array. Add your theme information e.g.

define( 'SITE_THEMES',
[
  'default' => ['display_label' => 'Default'],
  'your_theme' => ['display_label' => 'Your Theme']
]);

By doing this, the theme name (display_label value) will be shown in the dropdown list while choosing the theme from Admin Panel › Others › Settings › General (Site Theme).

For the views of your theme, create a folder inside the views directory e.g. views/your_theme

As the assets are the major parts of a theme/template so, you also have to create a folder inside the assets directory e.g. assets/your_theme

For the theme main folders (inside views and assets directories), the name must be the key that you will define in the SITE_THEMES (e.g. your_theme). For flexibility purposes, it's highly recommended to use the CI views. To get the theme name dynamically, use get_theme_name() function. It's also good idea to use the env_url() function instead of base_url().


Database Logics: All the script database logics (instead of ZUser library) are written inside the application/models directory so, you don't have to go to the controllers or view files for modifications.

For the script database functionality, you can find the available methods inside the application/core/MY_Model.php file but, as these methods are just covering the script core functionality so, it's highly recommended to use the CodeIgniter's query builder class.

Library Usage

1. Check the current visitor is logged in or not.

if ( $this->zuser->is_logged_in )
{
    // Logged In
}

2. Check the logged-in user has the specific permission or not.

if ( $this->zuser->has_permission( 'tickets' ) )
{
    // Allowed
}

3. Check the logged-in user is assigned a specific role or not.

if ( $this->zuser->role( 'agent' ) )
{
    // Assigned
}

4. To impersonate and exit the impersonation of any user.

$this->zuser->impersonate( $user_id );
$this->zuser->deimpersonate();

5. Get the specific field data of the logged-in user.

echo $this->zuser->get( 'first_name' );

Envato

Show/Hide
  • You can generate a API key or token here: https://build.envato.com/create-token/
  • For the Token name, you can enter any name. Mark as check the View the user's items' sales history option. After that, you'll have to agree with their Terms and Conditions by reading and marking as checked that I have read, understood and agree to the Terms and Conditions option and click on the Create Token button.
  • Copy the token and paste it in Admin Panel › Others › Settings › APIs › Envato.

When creating the Tickets or Chats, to ask the users about your item's purchase codes, you can find more settings under the Admin Panel › Others › Settings › Envato page.

Google

Show/Hide

Google reCaptcha:

  • Goto Google reCaptcha and do sign-in with your Google account.
  • Click on v3 Admin Console and fill the highlighted fields and click on Submit button.
  • Copy the Site and Secret keys and paste these in Admin Panel › Others › Settings › APIs › Google reCaptcha.

Google Analytics:

  • Goto Google Analytics and do sign in with your Google account.
  • Once you logged in, you will be required to register specifically with Google Analytics.
  • Fill in the required input fields to reach the next step.
  • After the filling, select a platform as Web and again fill in the information accordingly.
  • After the creation of an account, you will be redirected to a screen that is having the Measurement ID.
  • Copy the Measurement ID and paste it in Admin Panel › Others › Settings › APIs › Google Analytics.

After adding the ID, Google Analytics can take some time to work.

Social Login

Show/Hide

Facebook:

  • Goto Facebook Developers and do sign-in with your account and create an app.
  • After creating, find a section called Facebook Login and click on the Set Up button.
  • After setting up, select a platform as Web and input your URL (where the script is installed) in the Site URL field.
  • Goto Settings › Basic page and fill the required input fields and save the changes.
  • Scroll down and find a section called Website and add your website URL.
  • Goto Facebook Login › Setting page and add the callback URL e.g. https://yoururl.com/login/facebook.
  • Make the app mode live, click on In development toggle button (located at header), and switch the mode.
  • Copy the app keys and paste these in Admin Panel › Others › Settings › APIs › Facebook.

Facebook is now required to request access or permissions to use their API (in production mode). After setting up the app, you'll have to go to the App Review menu and click on Requests. The public_profile and email permissions are only required.


Google:

  • Goto Google Developers and login with your Gmail account.
  • Select an existing project or create a new one. To create a new project, click on the NEW PROJECT button.
  • Enter the name of your project. Under the name of the project, there is a unique Project ID that is automatically generated by Google, this ID can be changed (while creating the project) but, the value must be unique. Click on the CREATE button and the project will be created in few seconds.
  • Goto OAuth consent screen tab (located at sidebar) and select the User Type and click on CREATE button.
  • Fill in the required fields and save the changes.
  • Goto Credentials tab (located at sidebar) and click on CREATE CREDENTIALS button. Select OAuth client ID. After selecting you will be asked for the Application type, select Web application.
  • Click on ADD URI button and add the redirect URL e.g. https://yoururl.com/login/google. Click on CREATE button to complete this step.
  • Copy the client ID and client secret keys and paste these in Admin Panel › Others › Settings › APIs › Google Login.

Twitter:

  • Goto Twitter Developer and do sign-in with your account.
  • Request API access by submitting the application to Twitter.
  • Once you will get the approval notification, create an app.
  • After the creation of an app, Goto App Settings.
  • Enable the OAuth 1.0a and fill in all the required information. The Callback URLs field must contain the redirect URL e.g. https://yoururl.com/login/twitter.
  • Copy the Consumer Keys and paste these in Admin Panel › Others › Settings › APIs › Twitter.

Don't forget to enable the Request email address from users.


VKontakte: New

  • Visit VKontakte and sign in with your account.
  • Click the Add an Application button.
  • Fill in the required fields, ensuring you select Web as the platform.
  • Enter your domain name (without protocol or www) and set the Trusted Redirect URL to https://yoururl.com/login/vkontakte.
  • Copy the App ID and Secret Key, then paste them in Admin Panel › Others › Settings › APIs › VKontakte.

Geolocation

Show/Hide
  • Goto IPinfo and login to your account.
  • Goto IPInfo Token page and copy the Access Token and paste it in Admin Panel › Others › Settings › APIs › IPinfo.

The Geolocation Data option will not be visible until you add the IPinfo Access Token.

Email to Ticket

Show/Hide

The Email to Ticket feature, also known as email piping, empowers users to seamlessly convert incoming emails into support tickets. This functionality enables the creation of new tickets based on received emails and facilitates the posting of replies directly within the system, effectively tying responses to existing email threads. In essence, this feature bridges the gap between your email communication and ticket management, providing a streamlined and integrated approach to handling customer queries and support requests.

To use this feature, ensure you meet the following requirements:

  • PHP Version 8.1+: Make sure your system runs on PHP version 8.1 or higher.
  • Access to Cron Job Manager: Ensure access to the Cron Job Manager for scheduled tasks.
  • IMAP Module/Library: Enable the IMAP module/library for seamless email communication.
  • Email with IMAP Support: Your email account should support IMAP for effective ticket handling.
  • Email with Mail/SMTP Support: Ensure your email account supports Mail/SMTP for sending emails.

Follow the steps below for this feature:

  • Configure IMAP settings by navigating to Admin Panel › Others › Settings › IMAP page.
  • Set up email settings under Admin Panel › Others › Settings › Email page.
  • Schedule a cron job and customize the interval based on your needs. For instance, if you want to check every 5 minutes, execute the following command:

    */5 * * * * wget -O - https://yoururl.com/cron_job/email_to_ticket >/dev/null 2>&1

    For cPanel users, the steps to set up a cron job are outlined in the Installation section of this documentation.

  • The Email to Ticket feature is disabled by default; to enable it, navigate to the Admin Panel › Others › Settings › Support page. Change the Enable Email to Ticket field to activate the feature. Additionally, on the same page, you have the option to set default department and priority settings for tickets related to this feature.

Ensuring the smooth operation of the system is vital, and to achieve this, it's essential to employ the same email account for both IMAP and SMTP (or Mail). This consistency in sending and receiving is crucial for preventing disruptions in ticket management. I highly advise testing both IMAP and SMTP (or Mail) settings before activating this feature to guarantee its seamless functionality.

As an additional precaution, kindly consider adding an IMAP email account that is free of any existing unread emails and not associated with any newsletter subscriptions. This measure is in place to avoid unnecessary tickets, replies, and notifications, ensuring a more streamlined and efficient ticket management process.

This feature won't function unless the Tickets module is enabled in the settings.

A heartfelt request: I've invested considerable effort in fine-tuning this feature, conducting thorough tests with diverse emails across various platforms. If you come across any room for improvement or encounter issues, your valuable suggestions and feedback would be immensely appreciated. Your insights mean the world to me.

FAQs

These files are stored inside the assets/backups directory.

Open the file: sudo nano /etc/nginx/sites-available/default (depends on your operating system and settings) and try the below code and don't forget to restart your server: sudo service nginx restart

if ( $request_uri !~ ^/(index\.php|assets|uploads) )
{
    rewrite ^/(.*)$ /index.php/$1 last;
}

Read also FAQ #9 for more assistance.

You have to clear the cached files of your server.

Only allowed IP addresses and super admin users can access the website.

You can copy from the file that you downloaded from CodeCanyon and upload it again in the root directory.

Goto application/config/constants.php file and search for DB_BACKUP_TABLES array.

define( 'DB_BACKUP_TABLES', ['tickets', 'some_new_table', ...] );

http://yourwebsite.com, WEBSITE NAME, YOUR COMPANY ADDRESS, and email@yourwebsite.com. You must read the content and modify it accordingly.

You will have to modify your database settings by goto the application/config/database.php file and make sure about the required modules and permissions.

In very rare cases, the web servers return the wrong information to PHP about the mod_rewrite module so, if you're quite sure that this module is enabled on your web server OR you've rewritten the URLs on your NGINX server, then you can goto application/helpers/z_general_helper.php file and search for is_mod_rewrite_enabled and remove or comment the existing code and return the function as true e.g.

In that case, you can also face a different error message called Something went wrong, please try again later.
It's because your database server engine has failed to create the auto-increment for the table(s) and due to this, every record may be assigned the same ID (e.g. 0). It's in very rare database engines and the possibility that you are using the outdated or incompatible version of the engine. To fix this issue, open phpMyAdmin or whatever you're using to reach your database panel. Add the primary key and auto-increment to the id column for those tables that are not having these.

Changelog

@version is just used to inform that this (i.e. method) is added in the mentioned version of the script but, THERE CAN BE SOME OTHER CHANGE(S) WITHIN AN AFFECTED FILE so, you will have to make the updation very carefully to avoid any kind of issues, otherwise, the support will not responsible.

If you have added multiple languages translations, then you will have to add the newly added translations (if any when the script is updated) for all the languages that you have added, not just for English.

If you are installed the outdated version, you will have to update step by step according to your version, and PLEASE DON'T FORGET TO TAKE THE BACKUP OF YOUR EXISTING APPLICATION INCLUDING DATABASE.

Run the database queries in order. Also, check the changes after updating all the affected files otherwise you might face errors. If you're on the live server, then it's highly recommended to enable the maintenance mode (while doing the updation) by goto Admin Panel › Others › Settings › General › Maintenance.

Version 2.3 (16 August 2024)

// Run in phpMyAdmin or Whatever You're Using to Reach your Database Panel:
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'site_custom_js', '');
CREATE TABLE `tickets_tasks` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `title` VARCHAR(90) NOT NULL, `priority` VARCHAR(10) NOT NULL, `description` TEXT NOT NULL,`status` TINYINT UNSIGNED NOT NULL DEFAULT '0', `created_at` INT NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;
ALTER TABLE `tickets_tasks` ADD `user_id` INT UNSIGNED NULL AFTER `id`, ADD `ticket_id` INT UNSIGNED NOT NULL AFTER `user_id`;
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'vkontakte_app_id', ''), (NULL, 'vkontakte_secret_key', ''), (NULL, 'vkontakte_enable', '0');

// activities_lang:
Updated: $lang['av_ticket_reopened_agent']  = 'Ticket was Opened/Re-Opened by Team Member.';
$lang['av_ticket_task_added'] = 'Ticket Task was Added by %s.';
$lang['av_ticket_task_deleted'] = 'Ticket Task was Deleted by %s.';
$lang['av_ticket_task_updated'] = 'Ticket Task was Updated by %s.';
$lang['av_ticket_task_status_updated'] = 'Ticket Task Status was Updated by %s.';

// errors_lang:
$lang['err_cannot_close'] = 'Sorry, you cannot close this ticket.';
$lang['err_select_entries'] = 'Please select at least one entry to continue.';
$lang['err_no_permission'] = '403 - You do not have permission of this area.';

// global_lang:
$lang['custom_js'] = 'Custom JS';
$lang['custom_js_tip'] = 'Write your custom JS without using <q>script</q> tags.';
$lang['tasks'] = 'Tasks';
$lang['add_task'] = 'Add Task';
$lang['description'] = 'Description';
$lang['no_tasks'] = 'Currently, no tasks are available to display.';
$lang['edit_task'] = 'Edit Task';
$lang['select_action']  = 'Select Action';
$lang['open'] = 'Open';
$lang['apply'] = 'Apply';
$lang['select_carefully_note'] = '<strong>Important:</strong> Please review your selection carefully. This action is irreversible.';
$lang['reg_with_vkontakte'] = 'Registered with VKontakte';
$lang['continue_with_vkontakte'] = 'Continue with VKontakte';
$lang['vkontakte'] = 'VKontakte';
$lang['vkontakte_app_id'] = 'VKontakte App ID';
$lang['vkontakte_secret_key'] = 'VKontakte Secret Key';
$lang['enable_vkontakte_login'] = 'Enable VKontakte Login';

// success_lang:
$lang['suc_task_added'] = 'The task has been successfully added.';
$lang['suc_task_deleted'] = 'The task has been successfully deleted.';
$lang['suc_task_updated'] = 'The task has been successfully updated.';
$lang['suc_action_done']  = 'The command has been executed based on your selected action.';

// Affected Script Files:
* application/config/constants.php
* application/config/form_validation.php
* application/config/routes.php
* application/controllers/actions/admin/Settings.php
* application/controllers/actions/admin/Support.php
* application/controllers/actions/user/Support.php
* application/controllers/admin/Support.php
* application/controllers/Account.php
* application/core/MY_Controller.php
* application/core/MY_Loader.php
* application/helpers/z_general_helper.php
* application/language/english/activities_lang.php
* application/language/english/errors_lang.php
* application/language/english/global_lang.php
* application/language/english/success_lang.php
* application/libraries/ZUser.php
* application/libraries/ZVKontakte.php (Created)
* application/models/Login_model.php
* application/models/Support_model.php
* application/third_party/dompdf/*
* application/third_party/hybridauth/*
* application/views/default/admin/responses/forms/edit_ticket_task.php
* application/views/default/admin/settings/apis.php
* application/views/default/admin/settings/general.php
* application/views/default/admin/support/ticket.php
* application/views/default/admin/support/tickets.php
* application/views/default/admin/users/manage.php
* application/views/default/common/panel/footer.php
* application/views/default/common/public/footer.php
* application/views/default/common/public/header.php
* application/views/default/modals/panel/admin/add_ticket_task.php (Created)
* application/views/default/modals/panel/admin/delete_ticket_task.php (Created)
* application/views/default/user/account/social_auth_links.php
* application/views/default/user/support/ticket.php
* assets/default/css/public/style.css
* assets/default/css/custom.css
* assets/default/js/functions.js
* assets/default/panel/js/script.js

// What's New?
- Added a Custom JS Field in General Settings
- Enabled Multiple Ticket Selection for Closing, Opening, or Deleting
- Introduced Login with VKontakte Feature
- Added VKontakte API Settings Under Others > Settings > APIs > VKontakte
- Introduced a Ticket Tasks Option
- Fixed Notifications Icon Issue on Some Mobile Devices
- Improved Social Login User Image Management
- Fixed an Issue with the Installer
- Updated the Documentation
- Verified Compatibility with PHP 8.3
- Updated Backend Vendors

Version 2.2 (12 January 2024)

Show/Hide
// Run in phpMyAdmin or Whatever You're Using to Reach your Database Panel:
CREATE TABLE `tickets_emails` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `ticket_id` INT UNSIGNED NOT NULL, `message_id` VARCHAR(500) NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;
ALTER TABLE `tickets` CHANGE `department_id` `department_id` TINYINT(3) UNSIGNED NULL;
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'imap_host', ''), (NULL, 'imap_username', ''), (NULL, 'imap_password', ''), (NULL, 'enable_email_to_ticket', '0');
ALTER TABLE `tickets` ADD `source` TINYINT UNSIGNED NOT NULL DEFAULT '1' AFTER `status`;
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'tickets_default_department_id', '1');
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'tickets_default_priority', 'medium');
INSERT INTO `email_templates` (`id`, `title`, `subject`, `hook`, `language`, `template`, `is_built_in`, `updated_at`, `created_at`) VALUES (NULL, 'Ticket Confirmation', 'We\'ve Received Your Email! Ticket #{TICKET_ID}', 'ticket_confirmation', 'english', '<p>Dear Customer,<br><br>Greetings! This is an automatic email to inform you that your message has been successfully received. Your unique ticket reference number is {TICKET_ID}.<br><br>Should you have any additional information or updates you\'d like to share before our reply, please don\'t hesitate to respond to this email.<br><br>Thanks,<br>{SITE_NAME} Support</p>', '1', NULL, '1704453006');
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'imap_port', '993'), (NULL, 'imap_encryption', 'ssl'), (NULL, 'imap_validate_cert', '1'), (NULL, 'imap_protocol', 'imap');
INSERT INTO `email_templates` (`id`, `title`, `subject`, `hook`, `language`, `template`, `is_built_in`, `updated_at`, `created_at`) VALUES (NULL, 'Ticket Closed', 'Action Required: Create a New Ticket for Further Assistance', 'ticket_closed', 'english', '<p>Dear Customer,<br><br>We wanted to update you on the recent ticket (#{TICKET_ID}) you attempted to reply to—it has now been officially closed in our system. We understand that this may have caused some inconvenience, and for that, we sincerely apologize.<br><br>If your initial inquiry has been successfully addressed to your satisfaction, we are delighted to have provided assistance. Nevertheless, should you have any outstanding questions, concerns, or new inquiries, we recommend initiating a new ticket dedicated to each specific matter.<br><br>We appreciate your understanding and cooperation in this matter.<br><br>Thanks,<br>{SITE_NAME} Support</p>', '1', NULL, '1704881794');
CREATE TABLE `tickets_replies_quotes` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `ticket_reply_id` INT UNSIGNED NOT NULL, `message` TEXT NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;

// activities_lang:
$lang['av_ticket_created_email'] = 'Ticket was Created through Email.';
$lang['av_ticket_replied_email'] = 'Ticket was Replied through Email.';
$lang['av_ticket_closed_reply'] = 'Attempted to Submit a Reply through Email to the Closed Ticket.';
$lang['av_ticket_reopened_email'] = 'Ticket was Re-Opened through Email.';

// errors_lang:
$lang['err_incompatible_php'] = 'Sorry, your PHP version is not meeting the requirement, it must be at least PHP 8.1 installed in your server.';
$lang['err_imap_not_filled'] = 'Please fill in the IMAP settings to proceed.';
$lang['err_no_imap_library'] = 'The IMAP library is not installed or enabled on your server, it must be installed to proceed.';
$lang['err_requires_email_enable'] = 'The ticket was created through email, and it requires email feature to work before you add a reply to it.';

// global_lang:
$lang['default_department_ett'] = 'Default Department (Email to Ticket)';
$lang['default_priority_ett'] = 'Default Priority (Email to Ticket)';
$lang['enable_email_to_ticket'] = 'Enable Email to Ticket';
$lang['imap'] = 'IMAP';
$lang['imap_settings'] = 'IMAP Settings';
$lang['certificate'] = 'Certificate';
$lang['validate'] = 'Validate';
$lang['no_validate'] = 'No Validate';
$lang['sure_to_test_imap'] = '<strong class="text-primary">Are you sure to test it?</strong> by clicking on yes, the IMAP settings will be tested.';
$lang['quoted_message'] = 'Quoted Message';
$lang['add_email_settings'] = 'To ensure the proper functioning of this feature, kindly navigate to the <strong>(Admin Panel › Others › Settings › Email)</strong> page and configure your email settings. Afterward, please conduct a test to validate the configured settings.';

// success_lang:
$lang['suc_imap_tested'] = 'Your settings seems fine, good to go with the Email to Tickets feature.';

// Affected Script Files:
* application/config/constants.php
* application/controllers/actions/admin/Settings.php
* application/controllers/actions/admin/Support.php
* application/controllers/actions/user/Support.php
* application/controllers/admin/Settings.php
* application/controllers/Cron_job.php
* application/core/MY_Model.php
* application/helpers/z_general_helper.php
* application/helpers/z_support_helper.php
* application/language/english/activities_lang.php
* application/language/english/errors_lang.php
* application/language/english/global_lang.php
* application/language/english/success_lang.php
* application/libraries/ZImap.php (Created)
* application/libraries/ZMailer.php
* application/models/Support_model.php
* application/third_party/imap/* (Added)
* application/views/default/admin/settings/imap.php (Created)
* application/views/default/admin/settings/support.php
* application/views/default/admin/support/ticket.php
* application/views/default/common/panel/header.php
* application/views/default/home/support/guest_ticket.php
* application/views/default/modals/panel/admin/test_imap_settings.php (Created)
* application/views/default/user/support/ticket.php
* assets/default/js/script.js

// What's New?
- Added IMAP Settings
- Added Default Department and Priority Settings (Email to Ticket)
- Email to Ticket (Also Known as Email Piping)
- Fixed Minor Issue
- Updated Documentation

Version 2.1 (04 October 2023)

Show/Hide
// Run in phpMyAdmin or Whatever You're Using to Reach your Database Panel:
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'u_2f_authentication', '0');
ALTER TABLE `users` ADD `two_factor_authentication` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `is_verified`;
CREATE TABLE `users_rememberings` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT , `user_id` INT UNSIGNED NOT NULL , `token` VARCHAR(32) NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB;
INSERT INTO `email_templates` (`id`, `title`, `subject`, `hook`, `language`, `template`, `is_built_in`, `updated_at`, `created_at`) VALUES (NULL, 'Two Factor Authentication', 'Two Factor Authentication', '2f_authentication', 'english', '<p>Hi {USER_NAME},<br><br>Your two-factor authentication code is {2F_CODE}.<br><br>Thanks,<br>{SITE_NAME}<br></p>', '1', NULL, '1696239001');
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'u_2fa_cookie_expiry', '+1 year'), (NULL, 'u_2fa_show_remember', '1');

// activities_lang:
$lang['av_ticket_priority_changed'] = 'Ticket Priority was Changed by %s.';
$lang['av_ticket_department_changed'] = 'Ticket Department was Changed by %s.';

// errors_lang:
$lang['err_invalid_2fa_code'] = 'Invalid 2FA code, please try again.';
$lang['err_ticket_not_found'] = 'The ticket is not available (might be migrated to another department, removed, or inaccessible).';
$lang['err_chat_not_found'] = 'The chat is not available (might be migrated to another department, removed, or inaccessible).';

// global_lang:
$lang['2f_authentication'] = 'Two-Factor Authentication';
$lang['2f_auth_tagline'] = 'Please kindly have a look at your email address for the 2FA verification code.';
$lang['do_not_ask_browser'] = 'Do not ask again on this browser.';
$lang['2fa_cookie_expiry'] = '2FA Cookie Expiry';
$lang['2fa_show_remember'] = '2FA Show Remember Device';
$lang['change'] = 'Change';
$lang['change_department'] = 'Change Department';
$lang['change_priority'] = 'Change Priority';
$lang['loading'] = 'Loading...';

// success_lang:
$lang['suc_priority_changed'] = 'The priority is successfully changed.';
$lang['suc_department_changed'] = 'The department is successfully changed.';

// Affected Script Files:
* application/config/constants.php
* application/config/form_validation.php
* application/config/routes.php
* application/controllers/actions/admin/Settings.php
* application/controllers/actions/admin/Support.php
* application/controllers/actions/user/Account.php
* application/controllers/actions/Account.php
* application/controllers/admin/Support.php
* application/controllers/user/Account.php
* application/controllers/Account.php
* application/helpers/z_support_helper.php
* application/helpers/z_user_helper.php
* application/language/english/activities_lang.php
* application/language/english/errors_lang.php
* application/language/english/global_lang.php
* application/language/english/success_lang.php
* application/models/Login_model.php
* application/models/Support_model.php
* application/views/default/admin/settings/users.php
* application/views/default/admin/support/chat.php
* application/views/default/admin/support/chats.php
* application/views/default/admin/support/ticket.php
* application/views/default/admin/support/tickets.php
* application/views/default/common/panel/user/user_details.php
* application/views/default/common/panel/header.php
* application/views/default/common/public/header.php
* application/views/default/modals/panel/admin/change_chat_department.php (Created)
* application/views/default/modals/panel/admin/change_ticket_department.php (Created)
* application/views/default/modals/panel/admin/change_ticket_priority.php (Created)
* application/views/default/user/account/settings/profile_settings.php
* application/views/default/user/account/2f_authentication.php (Created)
* application/views/default/user/responses/limited_notifications.php (Created)
* assets/default/css/custom.css
* assets/default/js/script.js
* assets/default/panel/js/script.js

// What's New?
- Added 2FA (via Email)
- Added Change Ticket Department Option
- Added Change Ticket Priority Option
- Added Change Chat Department Option
- Improved Notifications System
- Minor Improvements

Version 2.0 (12 September 2023)

Show/Hide
// Run in phpMyAdmin or Whatever You're Using to Reach your Database Panel:
INSERT INTO `permissions` (`id`, `name`, `access_key`) VALUES (NULL, 'Delete Ticket', 'delete_ticket');
ALTER TABLE `tickets` ADD `feedback_type` TINYINT UNSIGNED NULL AFTER `attachment_name`, ADD `feedback` VARCHAR(500) NOT NULL AFTER `feedback_type`;
INSERT INTO `permissions` (`id`, `name`, `access_key`) VALUES (NULL, 'Edit Ticket Reply', 'edit_ticket_reply'), (NULL, 'Delete Ticket Reply', 'delete_ticket_reply'), (NULL, 'Delete Ticket Feedback', 'delete_ticket_feedback');
INSERT INTO `email_templates` (`id`, `title`, `subject`, `hook`, `language`, `template`, `is_built_in`, `updated_at`, `created_at`) VALUES (NULL, 'Ticket Feedback Shared by User', 'User Shared the Feedback to Assigned Ticket', 'ticket_feedback_shared', 'english', '<p>Hi {USER_NAME},<br><br>The user has shared the feedback to the ticket that\'s assigned to you. You can see the ticket by clicking on the following link:<br><a href=\"{TICKET_URL}\" target=\"_blank\">Click here</a><br><br>Thanks,<br>{SITE_NAME} Support<br></p>', '1', NULL, '1693640033');
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'module_knowledgebase', '1'), (NULL, 'module_faqs', '1'), (NULL, 'module_announcements', '1'), (NULL, 'module_tickets', '1');
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'envato_api_token', ''), (NULL, 'envato_ask_purchase_code_ticket', '0'), (NULL, 'envato_se_create_ticket', '0'), (NULL, 'envato_support_policy_url', 'https://codecanyon.net/page/item_support_policy');
INSERT INTO `permissions` (`id`, `name`, `access_key`) VALUES (NULL, 'Envato Purchase Information (Tickets & Chats)', 'envato_purchase_information');
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'envato_ask_purchase_code_chat', '0'), (NULL, 'envato_se_create_chat', '0');
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'envato_how_to_find_pc', 'https://help.market.envato.com/hc/en-us/articles/202822600-Where-Is-My-Purchase-Code-');
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'sp_allow_ticket_feedback_delete', '1');
CREATE TABLE `tickets_envato_responses` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `ticket_id` INT UNSIGNED NOT NULL, `envato_purchase_code` VARCHAR(255) NOT NULL, `envato_purchase_code_response` TEXT NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;
CREATE TABLE `chats_envato_responses` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `chat_id` INT UNSIGNED NOT NULL, `envato_purchase_code` VARCHAR(255) NOT NULL, `envato_purchase_code_response` TEXT NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB;

// If You've Added Any Permissions Other than the Default Permissions of the Script, Please Assign the Permissions to the Super Admin or Agent Roles Manually (Through the Admin Panel) Instead of Running These:
INSERT INTO `roles_permissions` (`id`, `role_id`, `permission_id`) VALUES (NULL, '1', '19');
INSERT INTO `roles_permissions` (`id`, `role_id`, `permission_id`) VALUES (NULL, '1', '20'), (NULL, '1', '21'), (NULL, '1', '22');
INSERT INTO `roles_permissions` (`id`, `role_id`, `permission_id`) VALUES (NULL, '1', '23');
INSERT INTO `roles_permissions` (`id`, `role_id`, `permission_id`) VALUES (NULL, '2', '23');

// activities_lang:
$lang['av_ticket_fb_shared'] = 'Ticket Feedback was Shared by Customer.';
$lang['av_ticket_fb_deleted'] = 'Ticket Feedback was Deleted by %s.';
$lang['av_ticket_fb_deleted_user'] = 'Ticket Feedback was Deleted by User.';

// errors_lang:
$lang['err_no_feedback'] = 'Please select a feedback type.';
$lang['err_invalid_pc'] = 'The purchase code is invalid.';
$lang['err_item_support_expired'] = 'Sorry, the support period for your item is ended on <q>%s</q>. <a class="text-white" href="%s" target="_blank"><u>Learn more</u></a>.';
$lang['err_envato_no_token_passed'] = 'Sorry, cannot proceed, no API token is passed by the admin for Envato.';
$lang['err_went_wrong_epc'] = 'Something went wrong while verifying your purchase code, please try again later.';

// global_lang:
$lang['theme_direction'] = 'ltr';
$lang['feedback_tagline'] = 'We would LOVE your Feedback';
$lang['great'] = 'Great';
$lang['poor'] = 'Poor';
$lang['share_feedback'] = 'Share Feedback';
$lang['requestor_feedback'] = 'Requestor\'s Feedback';
$lang['received_support'] = 'The requester received <u>%s</u> support.';
$lang['my_departments'] = 'My Departments';
$lang['my_departments_tickets'] = 'My Departments Tickets';
$lang['sure_delete_feedback'] = '<strong class="text-danger">Are you sure to delete it?</strong> by clicking on yes, your feedback will be deleted permanently but, you will be able to submit it again.';
$lang['great_received_support'] = 'The requester received Great support.';
$lang['poor_received_support'] = 'The requester received Poor support.';
$lang['purchase_code'] = 'Purchase Code';
$lang['htf_purchase_code'] = 'How to find your purchase code?';
$lang['envato_purchase_info'] = 'Envato Purchase Information';
$lang['item_name'] = 'Item Name';
$lang['purchase_count'] = 'Purchase Count';
$lang['purchase_code_eg'] = 'Purchase code from the platforms like CodeCanyon, Themeforest, etc';
$lang['buyer'] = 'Buyer';
$lang['supported_until'] = 'Supported Until';
$lang['support_amount'] = 'Support Amount';
$lang['license'] = 'License';
$lang['sold_at'] = 'Sold at';
$lang['amount'] = 'Amount';
$lang['modules'] = 'Modules';
$lang['modules_settings'] = 'Modules Settings';
$lang['envato'] = 'Envato';
$lang['envato_settings'] = 'Envato Settings';
$lang['api_token'] = 'API Token';
$lang['ask_tickets_pc'] = 'Ask For Purchase Code (Create Ticket)';
$lang['ask_chat_pc'] = 'Ask For Purchase Code (Create Chat)';
$lang['support_policy_url'] = 'Support Policy URL';
$lang['how_to_find_pc_link'] = 'How to Find Purchase Code Link';
$lang['can_ct_if_unsupported'] = 'Can Create Ticket if Support Period Ended';
$lang['can_cc_if_unsupported'] = 'Can Create Chat if Support Period Ended';
$lang['add_envato_api_token'] = 'Please add your Envato API Token under the <strong>(Admin Panel › Others › Settings › APIs › Envato)</strong> page if you want to verify the purchases.';
$lang['allow_ticket_fb_delete'] = 'Allow Users to Delete the Ticket Feedback';

// notifications_lang:
$lang['notify_ticket_feedback_shared'] = 'The user shared the feedback to the ticket that\'s assigned to you.';

// success_lang:
$lang['suc_ticket_fb_shared'] = 'Your feedback is successfully shared.';
$lang['suc_ticket_fb_deleted'] = 'The feedback is successfully deleted.';
$lang['suc_noti_deleted'] = 'The notification is successfully deleted.';

// Affected Script Files:
* application/config/constants.php
* application/config/routes.php
* application/controllers/actions/admin/Settings.php
* application/controllers/actions/admin/Support.php
* application/controllers/actions/user/Account.php
* application/controllers/actions/user/Support.php
* application/controllers/admin/Settings.php
* application/controllers/admin/Support.php
* application/controllers/user/Dashboard.php
* application/controllers/user/Support.php
* application/controllers/user/Tools.php
* application/controllers/Home.php
* application/controllers/Support.php
* application/controllers/core/MY_Model.php
* application/helpers/z_support_helper.php
* application/language/english/activities_lang.php
* application/language/english/errors_lang.php
* application/language/english/global_lang.php
* application/language/english/notifications_lang.php
* application/language/english/success_lang.php
* application/libraries/ZEnvato.php (Created)
* application/models/Notification_model.php
* application/models/Support_model.php
* application/third_party/EnvatoAPI.php (Added)
* application/views/default/admin/responses/forms/edit_tickets_department.php
* application/views/default/admin/responses/forms/edit_user_invitation.php
* application/views/default/admin/settings/apis.php
* application/views/default/admin/settings/envato.php (Created)
* application/views/default/admin/settings/general.php
* application/views/default/admin/settings/modules.php (Created)
* application/views/default/admin/settings/roles_permissions.php
* application/views/default/admin/settings/support.php
* application/views/default/admin/support/knowledge_base/edit_article.php
* application/views/default/admin/support/knowledge_base/new_article.php
* application/views/default/admin/support/chat.php
* application/views/default/admin/support/department_tickets.php
* application/views/default/admin/support/ticket.php
* application/views/default/admin/support/tickets.php
* application/views/default/admin/users/edit_user.php
* application/views/default/admin/users/tickets.php
* application/views/default/admin/notifications.php
* application/views/default/common/panel/user/user_details.php
* application/views/default/common/panel/header.php
* application/views/default/common/public/chat_box.php
* application/views/default/common/public/header.php
* application/views/default/home/support/article.php
* application/views/default/home/support/articles_block.php
* application/views/default/home/support/breadcrumb.php
* application/views/default/home/support/create_ticket.php
* application/views/default/home/support/faqs.php
* application/views/default/home/support/guest_ticket.php
* application/views/default/home/support/its_category.php
* application/views/default/home/still_no_luck.php
* application/views/default/home/welcome.php
* application/views/default/modals/panel/admin/add_tickets_department.php
* application/views/default/modals/panel/admin/delete_notification.php (Created)
* application/views/default/modals/panel/admin/delete_ticket_feedback.php (Created)
* application/views/default/modals/panel/admin/invite_user.php
* application/views/default/modals/panel/user/delete_notification.php (Created)
* application/views/default/modals/panel/user/delete_ticket_feedback.php (Created)
* application/views/default/user/account/notifications.php
* application/views/default/user/responses/chat_body.php
* application/views/default/user/support/create_ticket.php
* application/views/default/user/support/ticket.php
* application/views/default/user/tools/announcement.php
* application/views/default/user/tools/announcements.php
* application/views/default/user/user_dashboard.php
* assets/default/css/public/color_1.css
* assets/default/css/public/color_2.css
* assets/default/css/public/color_3.css
* assets/default/css/public/style.css
* assets/default/css/public/style.ltr.css (Created)
* assets/default/css/public/style.rtl.css (Created)
* assets/default/css/custom.css
* assets/default/css/custom.ltr.css (Created)
* assets/default/css/custom.rtl.css (Created)
* assets/default/js/script_public.js
* assets/default/panel/admin_lte/css/*
* assets/default/panel/js/script.js
* assets/default/vendor/bootstrap/*

// What's New?
- Added Theme RTL Layout Support
- Separated the My Department(s) Tickets
- Added Modules Settings (Tickets, Knowledge Base, FAQs, and Announcements) To Enable/Disable
- Added Purchase Code Verification (e.g. CodeCanyon, Themeforest) For Tickets
- Added Purchase Code Verification (e.g. CodeCanyon, Themeforest) For Chats
- Added Envato Settings (To Enable/Disable the Purchase Code Verification)
- Added the Tickets Feedbacks Feature
- Added the Delete Notification Option
- Added Delete Ticket Permission
- Added Edit Ticket Reply Permission
- Added Delete Ticket Reply Permission
- Minor Fixes and Improvements
- Updated AdminLTE CSS and Bootstrap
- Updated Documentation

Version 1.9 (11 June 2023)

Show/Hide
// Affected Script Files:
* application/config/constants.php
* application/core/MY_Controller.php
* application/core/MY_Loader.php (Created)
* application/third_party/dompdf/*
* application/third_party/hybridauth/*
* system/core/Controller.php
* system/core/Router.php
* system/core/URI.php
* system/database/DB_driver.php

// What's New?
- Added PHP 8.2 Support
- Updated Third-party Libraries

Version 1.8 (28 February 2023)

Show/Hide
// Run in phpMyAdmin or Whatever You're Using to Reach your Database Panel:
ALTER TABLE `articles` ADD `logged_in_only` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `visibility`;
ALTER TABLE `faqs` ADD `logged_in_only` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `visibility`;
ALTER TABLE `custom_fields` ADD `visibility` TINYINT UNSIGNED NOT NULL DEFAULT '1' AFTER `guide_text`;
CREATE TABLE `custom_pages` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(30) NOT NULL, `slug` VARCHAR(30) NOT NULL, `content` MEDIUMTEXT NOT NULL, `meta_description` VARCHAR(255) NOT NULL, `meta_keywords` VARCHAR(255) NOT NULL, `visibility` TINYINT UNSIGNED NOT NULL, `created_by` INT UNSIGNED NOT NULL, `updated_at` INT UNSIGNED NULL, `created_at` INT UNSIGNED NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;
ALTER TABLE `pages` CHANGE `content` `content` MEDIUMTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
CREATE TABLE `tickets_notes` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `user_id` INT UNSIGNED NULL, `ticket_id` INT UNSIGNED NOT NULL, `note` VARCHAR(500) NOT NULL, `attachment` VARCHAR(255) NOT NULL, `attachment_name` VARCHAR(255) NOT NULL, `created_at` INT UNSIGNED NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;

// activities_lang:
$lang['av_ticket_note_added'] = 'Ticket Note was Added by %s.';
$lang['av_ticket_note_deleted'] = 'Ticket Note was Deleted by %s.';

// global_lang:
Updated: $lang['no_replies'] = 'Currently, no replies are available to display.';
$lang['for_logged_in_only'] = 'For Logged-in Only';
$lang['custom_pages'] = 'Custom Pages';
$lang['create_custom_page'] = 'Create Custom Page';
$lang['edit_custom_page'] = 'Edit Custom Page';
$lang['creator'] = 'Creator';
$lang['notes'] = 'Notes';
$lang['no_notes'] = 'Currently, no notes are available to display.';
$lang['add_note'] = 'Add Note';
$lang['added_by'] = 'Added by %s';

// success_lang:
$lang['suc_note_added'] = 'Note is successfully added.';
$lang['suc_note_deleted'] = 'Note is successfully deleted.';

// Affected Script Files:
* application/config/constants.php
* application/config/form_validation.php
* application/config/routes.php
* application/controllers/actions/admin/Custom_fields.php
* application/controllers/actions/admin/Pages.php
* application/controllers/actions/admin/Support.php
* application/controllers/actions/admin/Tools.php
* application/controllers/admin/Pages.php
* application/controllers/admin/Support.php
* application/controllers/user/Support.php
* application/controllers/Home.php
* application/controllers/Support.php
* application/helpers/z_general_helper.php
* application/helpers/z_pages_helper.php
* application/language/english/activities_lang.php
* application/language/english/errors_lang.php
* application/language/english/global_lang.php
* application/language/english/success_lang.php
* application/models/Custom_field_model.php
* application/models/Page_model.php
* application/models/Support_model.php
* application/views/default/admin/responses/forms/edit_announcement.php
* application/views/default/admin/responses/forms/edit_custom_field.php
* application/views/default/admin/responses/forms/edit_faq.php
* application/views/default/admin/responses/add_announcement.php
* application/views/default/admin/responses/add_custom_field.php
* application/views/default/admin/responses/add_faq.php
* application/views/default/admin/responses/update_announcement.php
* application/views/default/admin/responses/update_custom_field.php
* application/views/default/admin/responses/update_faq.php
* application/views/default/admin/support/knowledge_base/articles.php
* application/views/default/admin/support/knowledge_base/edit_article.php
* application/views/default/admin/support/knowledge_base/new_article.php
* application/views/default/admin/support/faqs.php
* application/views/default/admin/support/ticket.php
* application/views/default/admin/tools/announcements.php
* application/views/default/admin/custom_fields.php
* application/views/default/admin/custom_pages.php (Created)
* application/views/default/admin/pages.php
* application/views/default/common/panel/header.php
* application/views/default/common/public/footer.php
* application/views/default/home/support/faqs.php
* application/views/default/home/page.php
* application/views/default/modals/panel/admin/add_announcement.php
* application/views/default/modals/panel/admin/add_custom_field.php
* application/views/default/modals/panel/admin/add_faq.php
* application/views/default/modals/panel/admin/add_ticket_note.php (Created)
* application/views/default/modals/panel/admin/create_custom_page.php (Created)
* application/views/default/modals/panel/admin/custom_pages.php (Created)
* application/views/default/modals/panel/admin/delete_ticket_note.php (Created)
* application/views/default/modals/panel/admin/pages.php
* application/views/default/user/tools/announcement.php
* application/views/default/user/tools/announcements.php
* assets/default/css/public/style.css
* assets/default/js/functions.php
* assets/default/panel/js/script.js
* assets/default/vendor/jquery/jquery_summernote.js (Added)
* assets/default/vendor/jquery/jquery_summernote.min.js (Added)

// What's New?
- Added Only for Logged in Users Content Option (Articles, FAQs)
- Added Custom Pages Module (e.g. About Us)
- Added Tickets Notes Feature with File Attachment
- Added Editor (Like Articles) in FAQs and Announcements
- Added the Visibility Option For Custom Fields
- Improvements and Bugs Fixing

Version 1.7.1 (12 December 2022)

Show/Hide
// Affected Script Files:
* application/config/constants.php
* assets/default/css/public/style.css

// What's New?
- Quick Fix (For 1.7): Social Login Buttons On-Click Color Issue (After Bootstrap Upgrade)

Version 1.7 (08 December 2022)

Show/Hide
// Run in phpMyAdmin or Whatever You're Using to Reach your Database Panel:
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'site_custom_css', '');
CREATE TABLE `tickets_replies_attachments` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `ticket_reply_id` INT UNSIGNED NOT NULL, `attachment` VARCHAR(255) NOT NULL, `attachment_name` VARCHAR(255) NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;
CREATE TABLE `tickets_attachments` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `ticket_id` INT UNSIGNED NOT NULL, `attachment` VARCHAR(255) NOT NULL, `attachment_name` VARCHAR(255) NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;

// global_lang:
Updated: $lang['download'] = 'Download';
Removed: $lang['attach_file_opt']
$lang['create_new'] = 'Create New';
$lang['custom_css'] = 'Custom CSS';
$lang['custom_css_tip'] = 'Write your custom CSS without using <q>style</q> tags.';
$lang['attach_files'] = 'Attach File(s)';
$lang['attachments'] = 'Attachment(s)';

// Affected Script Files:
* application/config/config.php
* application/config/constants.php
* application/config/mimes.php
* application/controllers/actions/admin/Settings.php
* application/controllers/actions/admin/Support.php
* application/controllers/actions/user/Support.php
* application/core/MY_Controller.php
* application/helpers/z_general_helper.php
* application/helpers/z_pages_helper.php
* application/helpers/z_security_helper.php
* application/helpers/z_support_helper.php
* application/language/english/global_lang.php
* application/models/Support_model.php
* application/third_party/hybridauth/*
* application/views/default/admin/responses/forms/edit_ticket_reply.php
* application/views/default/admin/settings/general.php
* application/views/default/admin/support/create_ticket.php
* application/views/default/admin/support/ticket.php
* application/views/default/common/panel/footer.php
* application/views/default/common/public/chat_box.php
* application/views/default/common/public/footer.php
* application/views/default/home/support/create_ticket.php
* application/views/default/home/support/guest_ticket.php
* application/views/default/home/still_no_luck.php
* application/views/default/modals/panel/admin/ticket_attachments.php
* application/views/default/modals/panel/user/delete_account.php
* application/views/default/modals/panel/user/delete_profile_picture.php
* application/views/default/modals/panel/user/delete_user_session.php
* application/views/default/modals/panel/user/end_chat.php
* application/views/default/modals/panel/user/logout_my_others.php
* application/views/default/modals/panel/user/mark_all_as_read.php
* application/views/default/modals/panel/user/resend_ticket_email.php
* application/views/default/modals/panel/user/ticket_attachments.php (Created)
* application/views/default/user/responses/chat_body.php
* application/views/default/user/support/create_ticket.php
* application/views/default/user/support/ticket.php
* assets/default/css/public/color_1.css
* assets/default/css/public/color_2.css
* assets/default/css/public/color_3.css
* assets/default/css/public/style.css
* assets/default/js/script.js
* assets/default/vendor/bootstrap/*
* assets/default/vendor/jquery/jquery.js
* assets/default/vendor/jquery/jquery.min.js
* assets/default/vendor/jquery/jquery.min.map
* system/*

// What's New?
- Added Support For PHP 8.1
- Added Multiple Attachments Support For Tickets and Replies
- Added Send Button For Chat Box (Public Area)
- Added Option to View Ticket Image Attachment (Public Area)
- Added a Button For Create New Ticket (Ticket View Page, Public Area)
- Added Custom CSS Field in General Settings
- Fixes, Adjustments, and Improvements
- Updated Some Vendors (Third-party Libraries)

Version 1.6 (25 August 2022)

Show/Hide
// Run in phpMyAdmin or Whatever You're Using to Reach your Database Panel:
ALTER TABLE `users` ADD `oauth_identifier` VARCHAR(255) NOT NULL AFTER `registration_source`;

// Guest Ticketing is Disabled by Default, Replace '0' with '1' to Enable it:
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'sp_guest_ticketing', '0');

INSERT INTO `email_templates` (`id`, `title`, `subject`, `hook`, `language`, `template`, `is_built_in`, `updated_at`, `created_at`) VALUES (NULL, 'Ticket Created by Guest', 'New Guest Ticket Created', 'ticket_created_guest', 'english', '<p>Dear Customer,<br><br>We have received a ticket submission request and a guest ticket has been successfully created for you.<br><br>Please kindly verify that the request was submitted by you, otherwise, you will not be able to add the replies: <a href=\"{EMAIL_LINK}\" target=\"_blank\">Verify Now</a><br><br>You can access it by clicking: <a href=\"{TICKET_URL}\" target=\"_blank\">View Ticket</a><br><br>If you didn\'t submit it, please kindly ignore this email (possibly the email address typing mistake).<br><br>Regards,<br>{SITE_NAME} Support</p>', '1', NULL, '1660817123');
INSERT INTO `email_templates` (`id`, `title`, `subject`, `hook`, `language`, `template`, `is_built_in`, `updated_at`, `created_at`) VALUES (NULL, 'Resend Ticket Access', 'Re-sent Guest Ticket Access URL', 'resend_ticket_access', 'english', '<p>Dear Customer,<br><br>We have resent the URL of your guest ticket #{TICKET_ID}.<br><br>You can access that ticket by clicking on the following link:<br><a href=\"{TICKET_URL}\" target=\"_blank\">Click here</a><br><br>Regards,<br>{SITE_NAME} Support</p>', '1', NULL, '1660931621');
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'i_pc_string', '');
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'i_pc_status', '0');
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'i_at', '1660930217');
ALTER TABLE `tickets` ADD `is_verified` TINYINT UNSIGNED NULL DEFAULT NULL AFTER `email_address`;
ALTER TABLE `tickets` ADD `email_attempts` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `is_verified`;
ALTER TABLE `tickets` ADD `last_email_attempt` INT UNSIGNED NULL AFTER `email_attempts`;
UPDATE `tickets` SET `is_verified` = 1 WHERE `is_verified` IS NULL;

// activities_lang:
$lang['av_ticket_access_resent'] = 'Ticket Access Link was Resent to the Customer.';
$lang['av_ticket_verified'] = 'Ticket was Verified by the Customer.';
$lang['av_ticket_email_resent'] = 'Ticket Verification Email was Resent by the Customer.';

// global_lang:
$lang['guest_email_guide'] = '<i class="fas fa-info-circle me-1"></i> Please make sure that it\'s accessible as this will be used to verify the ticket submission and receive its notifications.';
$lang['callback_url'] = '<strong>Callback URL:</strong> %s';
$lang['user_tickets'] = '%s › <span class="text-muted">Tickets</span>';
$lang['user_chats'] = '%s › <span class="text-muted">Chats</span>';
$lang['guest_ticketing'] = 'Guest Ticketing';
$lang['mailing_config_missing'] = 'You haven\'t filled in the configurations <strong>(Admin Panel › Others › Settings › Email)</strong> of your mailing server.';
$lang['resend_access'] = 'Resend Access';
$lang['resend_access_modal'] = '<strong class="text-primary">Are you sure to resend access?</strong> by clicking on yes, the access link of this guest ticket will be sent to the belonging email address.';
$lang['retype_email_address'] = 'Retype Email Address';
$lang['verify_ticket_email_msg'] = 'Please kindly verify your email address (belonging to this ticket) to add replies to it.';
$lang['havent_received_email'] = 'Haven\'t Received an Email? <a href="%s" class="fw-bold text-danger"><u>Resend</u></a>';
$lang['sure_resend'] = '<strong class="text-primary">Are you sure to resend it?</strong> by clicking on yes, the system will send the email again (if not reached the maximum limit).';

// errors_lang:
$lang['err_failed_email_status'] = 'The mailing engine returned an unsuccessful status, please kindly review in the receiver\'s inbox before trying again.';
$lang['err_already_verified'] = 'Sorry, cannot proceed, the record is already verified.';
$lang['err_reached_limited'] = 'Sorry, cannot proceed, you have reached the maximum limit.';
$lang['err_resend_wait_one_minute'] = 'After you resent it, you will have to wait for one minute before making another attempt.';

// success_lang:
$lang['suc_ticket_created_guest'] = 'The ticket is successfully created, please verify your email address <strong>( %s )</strong>.';
$lang['suc_ticket_verified'] = 'Your ticket request is successfully verified.';
$lang['suc_email_sent_command'] = 'The email sending command is successfully done.';

// Affected Script Files:
* application/config/constants.php
* application/config/form_validation.php
* application/config/routes.php
* application/controllers/actions/admin/Settings.php
* application/controllers/actions/admin/Support.php
* application/controllers/actions/user/Support.php
* application/controllers/admin/Support.php
* application/controllers/admin/Users.php
* application/controllers/Home.php
* application/controllers/Support.php
* application/helpers/z_general_helper.php
* application/helpers/z_response_helper.php
* application/helpers/z_support_helper.php
* application/language/english/activities_lang.php
* application/language/english/errors_lang.php
* application/language/english/global_lang.php
* application/language/english/success_lang.php
* application/libraries/ZUser.php
* application/models/Login_model.php
* application/models/Support_model.php
* application/third_party/hybridauth/*
* application/views/default/admin/settings/apis.php
* application/views/default/admin/settings/support.php
* application/views/default/admin/support/create_ticket.php
* application/views/default/admin/support/department_chats.php
* application/views/default/admin/support/department_tickets.php
* application/views/default/admin/support/ticket.php
* application/views/default/admin/users/chats.php (Created)
* application/views/default/admin/users/manage.php
* application/views/default/admin/users/tickets.php (Created)
* application/views/default/common/panel/user/user_details.php
* application/views/default/common/panel/header.php
* application/views/default/common/public/header.php
* application/views/default/home/support/article.php
* application/views/default/home/support/breadcrumb.php
* application/views/default/home/support/create_ticket.php (Created)
* application/views/default/home/support/guest_ticket.php
* application/views/default/home/support/search.php
* application/views/default/home/welcome.php
* application/views/default/modals/panel/admin/ticket_resend_access.php (Created)
* application/views/default/modals/panel/user/delete_account.php
* application/views/default/modals/panel/user/delete_profile_picture.php
* application/views/default/modals/panel/user/delete_user_session.php
* application/views/default/modals/panel/user/end_chat.php
* application/views/default/modals/panel/user/logout_my_others.php
* application/views/default/modals/panel/user/mark_all_as_read.php
* application/views/default/modals/panel/user/resend_ticket_email.php (Created)
* application/views/default/user/support/tickets.php
* assets/default/css/public/color_1.css
* assets/default/css/public/color_2.css
* assets/default/css/public/color_3.css
* assets/default/css/public/style.css
* assets/default/css/custom.css
* assets/default/js/functions.js
* assets/default/panel/js/script.js

// What's New?
- Added Guest Ticketing Feature
- Added Menus For Users All Tickets & Chats (Manage Users, Edit User)
- Added Tickets and Chats Counts For Each User & Department
- Added Option to Resend the Guest Ticket Access Link
- Added Option to Resend the Verification Email (Guest, Customer)
- Some Fixes, Minor Adjustments, and Improvements
- Updated the Documentation

Version 1.5 (30 April 2022)

Show/Hide
// BEFORE UPDATING TO V1.5, PLEASE MAKE SURE THAT YOU HAVE UPDATED TO V1.4.1 FROM V1.4.

// Run in phpMyAdmin or Whatever You're Using to Reach your Database Panel:
INSERT INTO `permissions` (`id`, `name`, `access_key`) VALUES (NULL, 'Custom Fields', 'custom_fields');
CREATE TABLE `custom_fields` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(90) NOT NULL, `type` VARCHAR(30) NOT NULL, `options` VARCHAR(1500) NOT NULL, `is_required` TINYINT UNSIGNED NOT NULL, `guide_text` VARCHAR(255) NOT NULL, `updated_at` INT UNSIGNED NULL, `created_at` INT UNSIGNED NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;
CREATE TABLE `tickets_custom_fields` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `ticket_id` INT UNSIGNED NOT NULL, `custom_field_id` TINYINT UNSIGNED NOT NULL, `value` TEXT NOT NULL, PRIMARY KEY  (`id`)) ENGINE = InnoDB;

// If You've Added Any Permissions Other than the Default Permissions of the Script, Please Assign the Permissions to the Super Admin or Agent Roles Manually (Through the Admin Panel) Instead of Running it:
INSERT INTO `roles_permissions` (`id`, `role_id`, `permission_id`) VALUES (NULL, '1', '18');

// errors_lang:
$lang['err_invalid_language'] = 'Invalid language input, please refresh your page and try again.';
$lang['err_nounread_notifications'] = 'Sorry, there are no unread notifications found.';
$lang['err_login_to_chat'] = 'Please login to your account and reload your page to continue the chatting.';
$lang['err_options_req'] = 'The Options field is required for the selected field type.';
$lang['err_missing_input'] = 'Missing input, please review the required (*) fields.';

// global_lang:
Removed: $lang['chat_subject'] = 'Subject: <strong>%s</strong>';
$lang['select_language'] = 'Select Language';
$lang['id_or_title'] = 'ID or Title';
$lang['any_visibility'] = 'Any Visibility';
$lang['subject_and_requestor'] = 'Subject & Requestor';
$lang['unregistered'] = 'Unregistered';
$lang['mark_all_as_read'] = 'Mark all as Read';
$lang['sure_mark_all_as_read'] = '<strong class="text-danger">Are you sure to proceed?</strong> by clicking on yes, any unread notifications will be marked as read and this command will not be undone.';
$lang['support_agents'] = 'Support Agents';
$lang['support_agents_tip'] = 'If selected as Support Agents, the team members with the Tickets and Chats permissions will be selected.';
$lang['custom_fields'] = 'Custom Fields';
$lang['add_custom_field'] = 'Add Custom Field';
$lang['edit_custom_field'] = 'Edit Custom Field';
$lang['field_type'] = 'Field Type';
$lang['text'] = 'Text';
$lang['textarea'] = 'Textarea';
$lang['checkbox'] = 'Checkbox';
$lang['select'] = 'Select';
$lang['radio'] = 'Radio';
$lang['guide_text'] = 'Guide Text';
$lang['options'] = 'Options';
$lang['cf_options_tip'] = 'For Checkbox, Select, or Radio, you have to specify the comma-separated values.';
$lang['required'] = 'Required';
$lang['browse_chats'] = 'Browse Chats';
$lang['dep_chats_title'] = '%s › <span class="text-muted">Chats</span>';
$lang['sure_delete_field'] = '<strong class="text-danger">Are you sure to delete it?</strong> by clicking on yes, this record with related inputs will be deleted permanently.';
$lang['additional_information'] = 'Additional Information';

// success_lang:
$lang['suc_noti_read'] = 'All the unread notifications are successfully marked as read.';

// Affected Script Files:
* application/config/constants.php
* application/config/form_validation.php
* application/controllers/actions/admin/Custom_fields.php (Created)
* application/controllers/actions/admin/Support.php
* application/controllers/actions/user/Account.php
* application/controllers/actions/user/Support.php
* application/controllers/admin/Custom_fields.php (Created)
* application/controllers/admin/Support.php
* application/controllers/user/Account.php
* application/controllers/user/Support.php
* application/controllers/Account.php
* application/controllers/Support.php
* application/helpers/z_general_helper.php
* application/helpers/z_security_helper.php
* application/helpers/z_support_helper.php
* application/helpers/z_user_helper.php
* application/language/english/errors_lang.php
* application/language/english/global_lang.php
* application/language/english/success_lang.php
* application/models/Custom_field_model.php (Created)
* application/models/Notification_model.php
* application/models/Setting_model.php
* application/models/Support_model.php
* application/views/default/admin/responses/forms/edit_custom_field.php (Created)
* application/views/default/admin/responses/forms/edit_tickets_department.php
* application/views/default/admin/responses/add_custom_field.php (Created)
* application/views/default/admin/responses/add_tickets_department.php
* application/views/default/admin/responses/update_custom_field.php (Created)
* application/views/default/admin/responses/update_tickets_department.php
* application/views/default/admin/support/knowledge_base/articles.php
* application/views/default/admin/support/chat.php
* application/views/default/admin/support/chats.php
* application/views/default/admin/support/create_ticket.php
* application/views/default/admin/support/department_chats.php (Created)
* application/views/default/admin/support/department_tickets.php
* application/views/default/admin/support/departments.php
* application/views/default/admin/support/ticket.php
* application/views/default/admin/support/tickets.php
* application/views/default/admin/custom_fields.php (Created)
* application/views/default/admin/notifications.php
* application/views/default/common/panel/user/user_details.php
* application/views/default/common/panel/header.php
* application/views/default/common/public/chat_box.php
* application/views/default/common/public/header.php
* application/views/default/common/custom_fields.php (Created)
* application/views/default/home/support/guest_ticket.php
* application/views/default/modals/panel/admin/add_custom_field.php (Created)
* application/views/default/modals/panel/admin/add_tickets_department.php
* application/views/default/modals/panel/admin/mark_all_as_read.php (Created)
* application/views/default/modals/panel/admin/view_profile_picture.php
* application/views/default/modals/panel/user/mark_all_as_read.php (Created)
* application/views/default/modals/panel/delete.php
* application/views/default/user/account/settings/profile_settings.php
* application/views/default/user/account/notifications.php
* application/views/default/user/support/create_ticket.php
* application/views/default/user/support/ticket.php
* assets/default/css/public/style.css
* assets/default/css/custom.css
* assets/default/js/script_public.js
* assets/default/panel/js/script.js
* system/core/Security.php

// What's New?
- Added Search Articles Feature in the Admin Panel
- Added Mark All Notifications as Read Feature
- Added Language Option in the User Settings
- Added Browse Department Chats Page
- Added Custom Fields Module (Tickets Creation)
- Some Minor Fixes, Adjustments, and Improvements
- Updated the Documentation

Version 1.4.1 (27 January 2022)

Show/Hide
// Affected Script Files:
* application/config/constants.php
* application/helpers/z_general_helper.php
* application/models/Support_model.php
* application/views/default/admin/support/chats.php
* application/views/default/admin/support/department_tickets.php
* application/views/default/admin/support/tickets.php
* application/views/default/common/public/chat_box.php
* assets/default/css/public/style.css
* assets/default/css/custom.css

// What's New?
- Some Fixes and Minor Improvements

Version 1.4 (14 December 2021)

Show/Hide
// Run in phpMyAdmin or Whatever You're Using to Reach your Database Panel:
CREATE TABLE IF NOT EXISTS `chats` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `subject` VARCHAR(90) NOT NULL, `message` TEXT NOT NULL, `user_id` INT UNSIGNED NOT NULL, `assigned_to` INT UNSIGNED NULL, `department_id` INT UNSIGNED NOT NULL, `is_read` TINYINT UNSIGNED NOT NULL DEFAULT '0', `is_read_assigned` INT UNSIGNED NOT NULL DEFAULT '1', `sub_status` TINYINT UNSIGNED NOT NULL DEFAULT '1', `status` TINYINT UNSIGNED NOT NULL DEFAULT '1', `ended_by` INT UNSIGNED NULL, `updated_at` INT UNSIGNED NULL, `created_month_year` VARCHAR(7) NOT NULL, `created_at` INT UNSIGNED NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS `chats_replies` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `chat_id` INT UNSIGNED NOT NULL, `user_id` INT UNSIGNED NOT NULL, `message` TEXT NOT NULL, `replied_at` INT UNSIGNED NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;
INSERT INTO `permissions` (`id`, `name`, `access_key`) VALUES (NULL, 'Chats', 'chats'), (NULL, 'All Chats', 'all_chats');
INSERT INTO `permissions` (`id`, `name`, `access_key`) VALUES (NULL, 'Reports', 'reports');

// Live Chatting Module is Disabled by Default, Replace '0' with '1' to Enable it:
INSERT INTO `settings` (`id`, `access_key`, `value`) VALUES (NULL, 'sp_live_chatting', '0');

// If You've Added Any Permissions Other than the Default Permissions of the Script, Please Assign the Permissions to the Super Admin and Agent Roles Manually (Through the Admin Panel) Instead of Running These Three Queries:
INSERT INTO `roles_permissions` (`id`, `role_id`, `permission_id`) VALUES (NULL, '1', '15'), (NULL, '1', '16');
INSERT INTO `roles_permissions` (`id`, `role_id`, `permission_id`) VALUES (NULL, '2', '15');
INSERT INTO `roles_permissions` (`id`, `role_id`, `permission_id`) VALUES (NULL, '1', '17');

ALTER TABLE `chats_replies` ADD `area` TINYINT UNSIGNED NOT NULL DEFAULT '2' AFTER `message`;
INSERT INTO `email_templates` (`id`, `title`, `subject`, `hook`, `language`, `template`, `is_built_in`, `updated_at`, `created_at`) VALUES (NULL, 'Department Chat', 'New Chat Assigned to Department: {DEPARTMENT_NAME}', 'department_chat', 'english', '<p>Hi {USER_NAME},<br><br>A new chat has been assigned to your <b>{DEPARTMENT_NAME}</b> department.<br><br>You can see the assigned chat by clicking on the following link:<br><a href=\"{CHAT_URL}\" target=\"_blank\">Click here</a><br><br>Regards,<br>{SITE_NAME} Support</p>', '1', NULL, '1638553679');
CREATE TABLE IF NOT EXISTS `reports` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `users` INT UNSIGNED NOT NULL, `opened_tickets` INT UNSIGNED NOT NULL, `closed_tickets` INT UNSIGNED NOT NULL, `solved_tickets` INT UNSIGNED NOT NULL, `total_tickets` INT UNSIGNED NOT NULL, `active_chats` INT UNSIGNED NOT NULL, `ended_chats` INT UNSIGNED NOT NULL, `total_chats` INT UNSIGNED NOT NULL, `period` VARCHAR(255) NOT NULL, `generated_at` INT UNSIGNED NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;
ALTER TABLE `tickets` ADD `security_key` VARCHAR(255) NOT NULL AFTER `department_id`;
ALTER TABLE `tickets` ADD `email_address` VARCHAR(255) NOT NULL AFTER `security_key`;
ALTER TABLE `tickets_replies` CHANGE `user_id` `user_id` INT(10) UNSIGNED NULL DEFAULT NULL;
INSERT INTO `email_templates` (`id`, `title`, `subject`, `hook`, `language`, `template`, `is_built_in`, `updated_at`, `created_at`) VALUES (NULL, 'Ticket Created (Unregistered User)', 'New Ticket Created For You', 'ticket_created_unregistered_user', 'english', '<p>Dear Customer,<br><br>A new ticket has been created for you by our support agent.<br><br>You can reach that ticket by clicking on the following link:<br><a href=\"{TICKET_URL}\" target=\"_blank\">Click here</a><br><br>Regards,<br>{SITE_NAME} Support</p>', '1', NULL, '1638868973');
ALTER TABLE `tickets` ADD `last_reply_area` TINYINT UNSIGNED NULL DEFAULT NULL AFTER `reopened_awaiting`;
INSERT INTO `email_templates` (`id`, `title`, `subject`, `hook`, `language`, `template`, `is_built_in`, `updated_at`, `created_at`) VALUES (NULL, 'Chat Assigned', 'Chat Assigned', 'chat_assigned', 'english', '<p>Hi {USER_NAME},<br><br>You have been assigned a chat. You can see the chat by clicking on the following link:<br><a href=\"{CHAT_URL}\" target=\"_blank\">Click here</a><br><br>Regards,<br>{SITE_NAME} Support</p>', '1', NULL, '1639160537');

// activities_lang:
$lang['av_ticket_solved_user'] = 'Ticket was Marked as Solved by User.';
$lang['av_ticket_solved_admin'] = 'Ticket was Marked as Solved by Team Member.';

// errors_lang:
Updated: $lang['err_not_updated_user'] = 'Seems the record is already assigned to the selected user.';
$lang['err_review_ip'] = 'Invalid IP(s) found, please review the IP addresses field.';
$lang['err_already_chatting'] = 'Sorry, you already have an active chat, please end that chat first.';
$lang['err_cant_assign_closed'] = 'Sorry, the closed ticket cannot be assigned until it is reopened.';
$lang['err_cant_assign_ended'] = 'Sorry, the ended chat cannot be assigned until it is reactivated.';
$lang['err_cant_self_assign_chat'] = 'The user that is going to be assigned to this chat, must not be its requester.';
$lang['err_chat_ended'] = 'The reply cannot be added to the ended chat.';
$lang['err_no_chat_available'] = 'Sorry, no agents are online at that moment, please try again later or create a new ticket.';

// global_lang:
Removed: $lang['tickets_departments'] = 'Tickets Departments';
Removed: $lang['ticket_subject'] = 'Ticket Subject';
Updated: $lang['ver_before_submit_tip'] = 'If selected as Yes, the user will be required to verify the email address to submit the ticket and chatting requests.';
Updated: $lang['sp_everification_req'] = 'Email verification is required to submit, please kindly activate your account.';
$lang['chats'] = 'Chats';
$lang['all_chats'] = 'All Chats';
$lang['assigned_chats'] = 'Assigned Chats';
$lang['tickets_and_chats'] = 'Tickets & Chats';
$lang['search_chats'] = 'Search Chats';
$lang['ended'] = 'Ended';
$lang['assigned_chats_msg'] = '( list of chats that are assigned to you )';
$lang['c_assigned_to_dptmt_msg'] = '( list of chats that are assigned to the departments belongs to you )';
$lang['active_chats'] = 'Active Chats';
$lang['ended_chats'] = 'Ended Chats';
$lang['live_chatting'] = 'Live Chatting';
$lang['support_chat'] = 'Support Chat';
$lang['available'] = 'Available';
$lang['account_login_required'] = 'Account login is required to start, please <a href="%s" class="text-sub">login</a> to your account to proceed.';
$lang['type_message'] = 'Type your message here...';
$lang['sent_by_at'] = '<strong>%s</strong> at %s';
$lang['waiting_agent'] = 'Waiting for some agent to connect with you, thanks for the patience.';
$lang['unavailable'] = 'Unavailable';
$lang['agents_offline'] = 'Sorry currently no agent is available, please try later or create a new <a href="%s" class="text-sub">ticket</a>.';
$lang['chat_subject'] = 'Subject: <strong>%s</strong>';
$lang['already_chatting'] = 'Seems there is an active chat from a different account and after starting another one from this browser, the old one will not be accessible.';
$lang['end_chat'] = 'End Chat';
$lang['reports'] = 'Reports';
$lang['report'] = 'Report';
$lang['report_number'] = 'Report #';
$lang['type'] = 'Type';
$lang['count'] = 'Count';
$lang['solved_tickets'] = 'Solved Tickets';
$lang['total_tickets'] = 'Total Tickets';
$lang['total_chats'] = 'Total Chats';
$lang['registered_users'] = 'Registered Users';
$lang['report_pdf'] = 'Report (.pdf)';
$lang['generate_report'] = 'Generate Report';
$lang['period'] = 'Period';
$lang['generated'] = 'Generated';
$lang['sure_generate_report'] = '<strong class="text-primary">Are you sure to generate the report?</strong> by clicking on yes, a report will be generated based on your selection.';
$lang['past_3_days'] = 'Past 3 Days';
$lang['past_7_days'] = 'Past 7 Days';
$lang['past_2_weeks'] = 'Past 2 Weeks';
$lang['past_1_month'] = 'Past 1 Month';
$lang['past_3_months'] = 'Past 3 Months';
$lang['past_6_months'] = 'Past 6 Months';
$lang['past_12_months'] = 'Past 12 Months';
$lang['all_time'] = 'All Time';
$lang['chat_url'] = 'Chat URL';
$lang['for_registered_users'] = 'For Registered Users';
$lang['for_unregistered_users'] = 'For Unregistered Users';
$lang['open_guest_view'] = 'Open (Guest View)';
$lang['customer_email_tip'] = 'Please make sure that the inputted email address is correct as this will be used to send the ticket-related notifications.';
$lang['chat_no'] = 'Chat No. #%u';
$lang['chat_ended_by_msg'] = 'This chat has been ended by %s.';
$lang['sure_assign_user_chat'] = '<strong class="text-primary">Are you sure to assign it?</strong> by clicking on yes, this chat will be assigned to the selected user.';
$lang['ticket_chat_subject'] = 'Ticket/Chat Subject';
$lang['sure_end_chat'] = '<strong class="text-danger">Are you sure to end it?</strong> by clicking on yes, the chat session will be ended and the user will not be able to access it.';
$lang['sure_end_chat_user'] = '<strong class="text-danger">Are you sure to end it?</strong> by clicking on yes, the chat session will be ended and you will not be able to proceed with it.';
$lang['admin_chat_reply_tip'] = 'Press Enter to send and Shift + Enter to add a new line.';

// notifications_lang:
$lang['notify_chat_assigned_department'] = 'A new chat has been assigned to one of your departments.';
$lang['notify_chat_assigned'] = 'A new chat has been assigned to you.';

// success_lang:
$lang['suc_report_generated'] = 'The report is successfully generated based on your selection.';
$lang['suc_assigned_user_c'] = 'The chat is successfully assigned to the selected user.';
$lang['suc_unassigned'] = 'The record is successfully unassigned.';
$lang['suc_chat_ended'] = 'The chat is successfully marked as ended.';

// Affected Script Files:
* application/config/constants.php
* application/config/form_validation.php
* application/config/routes.php
* application/controllers/actions/admin/Reports.php (Created)
* application/controllers/actions/admin/Settings.php
* application/controllers/actions/admin/Support.php
* application/controllers/actions/user/Support.php
* application/controllers/admin/Reports.php (Created)
* application/controllers/admin/Support.php
* application/controllers/admin/Users.php
* application/controllers/user/Support.php
* application/controllers/Account.php
* application/controllers/Support.php
* application/core/MY_Model.php
* application/helpers/z_general_helper.php
* application/helpers/z_response_helper.php
* application/helpers/z_support_helper.php
* application/language/english/activities_lang.php
* application/language/english/errors_lang.php
* application/language/english/global_lang.php
* application/language/english/notifications_lang.php
* application/language/english/success_lang.php
* application/language/english/upload_lang.php (Added)
* application/libraries/Zpdf.php (Created)
* application/models/Report_model.php (Created)
* application/models/Support_model.php
* application/third_party/dompdf (Added)
* application/views/default/admin/responses/forms/edit_canned_reply.php
* application/views/default/admin/responses/add_report.php (Created)
* application/views/default/admin/responses/chat_body.php (Created)
* application/views/default/admin/settings/support.php
* application/views/default/admin/support/chat.php (Created)
* application/views/default/admin/support/chats.php (Created)
* application/views/default/admin/support/create_ticket.php
* application/views/default/admin/support/department_tickets.php
* application/views/default/admin/support/departments.php
* application/views/default/admin/support/ticket.php
* application/views/default/admin/support/tickets.php
* application/views/default/admin/report.php (Created)
* application/views/default/admin/reports.php (Created)
* application/views/default/common/panel/header.php
* application/views/default/common/public/chat_box.php (Created)
* application/views/default/common/public/footer.php
* application/views/default/common/public/header.php
* application/views/default/common/maintenance.php
* application/views/default/home/support/guest_ticket.php (Created)
* application/views/default/modals/panel/admin/add_canned_reply.php
* application/views/default/modals/panel/admin/add_email_template.php
* application/views/default/modals/panel/admin/assign_user_chat.php (Created)
* application/views/default/modals/panel/admin/emails.php
* application/views/default/modals/panel/admin/end_chat.php (Created)
* application/views/default/modals/panel/admin/generate_report.php (Created)
* application/views/default/modals/panel/user/delete_account.php
* application/views/default/modals/panel/user/end_chat.php (Created)
* application/views/default/user/responses (Created Folder and All Child Files)
* application/views/default/user/support/ticket.php
* application/views/default/user/support/tickets.php
* application/views/default/user/dashboard.php
* assets/default/css/public/color_01.css
* assets/default/css/public/color_02.css
* assets/default/css/public/color_03.css
* assets/default/css/public/style.css
* assets/default/css/custom.css
* assets/default/css/report_pdf.css (Created)
* assets/default/images/color_1/headset_support.svg (Added)
* assets/default/images/color_2/headset_support.svg (Added)
* assets/default/images/color_3/headset_support.svg (Added)
* assets/default/images/envelope_open.svg (Added)
* assets/default/js/functions.js
* assets/default/js/script_public.js (Created)
* assets/default/panel/js/chat_script.js (Created)
* assets/default/panel/js/script.js
* system/libraries/Session/Session.php
* system/libraries/Migration.php

// What's New?
- Some Minor Fixes, Adjustments, and Improvements
- Added Feature to Create Ticket on Behalf of Customer
- Added Mark Ticket as Solved by User Option
- Added Live Chatting Feature and Module
- Added Reports Module
- Added PHP 8.0 Support
- Improved the Documentation

Version 1.3 (14 September 2021)

Show/Hide
// errors_lang:
$lang['err_delete_dep_tickets'] = 'Please delete the belonging tickets to delete it.';

// global_lang:
$lang['view_article'] = 'View Article';
$lang['site_color_tip'] = 'The selected color will be applied to the public site area.';
$lang['search_tickets'] = 'Search Tickets';
$lang['subject_or_id'] = 'Subject or ID';
$lang['any_reply_status'] = 'Any Reply Status';
$lang['all_priorities'] = 'All Priorities';
$lang['search'] = 'Search';
$lang['browse_tickets'] = 'Browse Tickets';
$lang['dep_tickets_title'] = '%s › <span class="text-muted">Tickets</span>';

// Affected Script Files:
* application/config/constants.php
* application/controllers/actions/admin/Support.php
* application/controllers/actions/admin/Users.php
* application/controllers/actions/Account.php
* application/controllers/admin/Support.php
* application/controllers/user/Support.php
* application/core/MY_Model.php
* application/helpers/z_general_helper.php
* application/helpers/z_support_helper.php
* application/helpers/z_user_helper.php
* application/language/english/errors_lang.php
* application/language/english/global_lang.php
* application/models/Login_model.php
* application/models/Support_model.php
* application/views/default/admin/responses/add_tickets_department.php
* application/views/default/admin/responses/update_tickets_department.php
* application/views/default/admin/settings/general.php
* application/views/default/admin/support/knowledge_base/edit_article.php
* application/views/default/admin/support/departments.php
* application/views/default/admin/support/department_tickets.php (Created)
* application/views/default/admin/support/ticket.php
* application/views/default/admin/support/tickets.php
* application/views/default/common/panel/header.php
* application/views/default/common/public/header.php
* application/views/default/modals/panel/admin/ticket_attachments.php
* application/views/default/user/support/ticket.php
* application/views/default/user/support/tickets.php
* application/views/default/user/user_dashboard.php
* assets/default/css/public/style.css
* assets/default/css/custom.css
* assets/default/js/functions.js
* assets/default/panel/js/script.js

// What's New?
- Added Search Tickets Option for User Area
- Added Tickets Filters in Admin Area
- Fixed Some Minor, Cron Job and Summernote Related Issues
- Some Minor Adjustments and Improvements

Version 1.2 (22 August 2021)

Show/Hide
// Run in phpMyAdmin or Whatever You're Using to Reach your Database Panel:
ALTER TABLE `tickets` ADD `reopened_awaiting` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `last_agent_replied_at`;

// global_lang:
$lang['hidden_post'] = '<strong>NOTE:</strong> This post is hidden (not publically visible).';
$lang['awaiting_user_reply'] = 'Awaiting User Reply';
$lang['awaiting_your_reply'] = 'Awaiting Your Reply';

// Affected Script Files:
* application/config/constants.php
* application/controllers/actions/admin/Support.php
* application/controllers/admin/Support.php
* application/controllers/Support.php
* application/helpers/z_support_helper.php
* application/helpers/z_user_helper.php
* application/language/english/global_lang.php
* application/models/Support_model.php
* application/views/default/admin/support/tickets.php
* application/views/default/common/panel/header.php
* application/views/default/common/public/header.php
* application/views/default/home/support/article.php
* application/views/default/user/account/settings/profile_settings.php
* application/views/default/user/account/forgot_password.php
* assets/default/css/public/style.css
* assets/default/js/functions.js

// What's New?
- Fixed Image Changing Issue on Edit User Page
- Fixed the Position of Delete Icon for Profile Image
- Fixed Forgot Password Page HTML
- Fixed the Tickets Auto Closing Related Issue
- Some Minor Improvements

Version 1.1 (16 August 2021)

Show/Hide
// Run in phpMyAdmin or Whatever You're Using to Reach your Database Panel:
ALTER TABLE `tickets_replies` ADD `updated_at` INT UNSIGNED NULL DEFAULT NULL AFTER `attachment_name`;

// activities_lang:
$lang['av_ticket_created_admin'] = 'Ticket was Created by Team Member for User.';
$lang['av_ticket_reply_updated'] = 'Ticket Reply was Updated by %s.';

// global_lang:
$lang['edit_reply'] = 'Edit Reply';
$lang['edited_brackets'] = '( edited )';
$lang['customer'] = 'Customer';
$lang['select_customer'] = 'Select Customer';
$lang['change_attached_file'] = 'Change Attached File (Optional)';
$lang['download'] = 'Download ( %s )';

// Affected Script Files:
* application/config/constants.php
* application/config/form_validation.php
* application/config/routes.php
* application/controllers/actions/admin/Support.php
* application/controllers/actions/user/Support.php
* application/controllers/admin/Support.php
* application/controllers/user/Tools.php
* application/helpers/z_general_helper.php
* application/helpers/z_support_helper.php
* application/language/english/activities_lang.php
* application/language/english/global_lang.php
* application/models/Support_model.php
* application/models/User_model.php
* application/views/default/admin/responses/forms/edit_ticket_reply.php (Created)
* application/views/default/admin/support/create_ticket.php (Created)
* application/views/default/admin/support/ticket.php
* application/views/default/admin/support/tickets.php
* application/views/default/admin/users/edit_user.php
* application/views/default/common/panel/header.php
* application/views/default/modals/panel/admin/ticket_attachments.php (Created)
* assets/default/css/custom.css

// What's New?
- Added Option in Admin Panel to Create Ticket for Users
- Added Modal Popup for Image Attachments in Admin Panel
- Added Option to Edit the Tickets Replies
- Fixed View Image Modal Issue for Admin Edit User

Version 1.0 (15 August 2021)

- Initial Release

© Z Desk Documentation 2023 - All Rights Reserved.